package com.kymatrix.mpo.plus.bpm.server.config;

import com.kymatrix.mpo.plus.bpm.server.filter.FlowableWebFilter;
import com.kymatrix.mpo.plus.common.constants.Constant;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * bpm 模块的 web 组件的 Configuration
 */
@Configuration(proxyBeanMethods = false)
public class BpmWebConfiguration {


    /**
     * 配置 Flowable Web 过滤器
     */
    @Bean
    public FilterRegistrationBean<FlowableWebFilter> flowableWebFilter() {
        FilterRegistrationBean<FlowableWebFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new FlowableWebFilter());
        registrationBean.setOrder(Constant.WebFilterOrderConstants.FLOWABLE_FILTER);
        return registrationBean;
    }

}
